const arr = [1, 1, 1, 2, 2, 3, 4, 5, 6, 3, 4, 2, 4, 1,];
const result = arr.sort().reduce((pre, cur) => {
  if (!pre.includes(cur)) {
    pre.push(cur)
  }
  return pre;
}, []);
console.log(result)
